package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.hospital.domain.YlDoctor;
import com.ruoyi.hospital.mapper.YlDoctorMapper;
import com.ruoyi.hospital.service.IYlDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 医生信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-16
 */
@Service
public class YlDoctorServiceImpl implements IYlDoctorService
{
    @Autowired
    private YlDoctorMapper ylDoctorMapper;

    /**
     * 查询医生信息
     * 
     * @param doctorId 医生信息主键
     * @return 医生信息
     */
    @Override
    public YlDoctor selectYlDoctorByDoctorId(Long doctorId)
    {
        return ylDoctorMapper.selectYlDoctorByDoctorId(doctorId);
    }

    /**
     * 查询医生信息列表
     * 
     * @param ylDoctor 医生信息
     * @return 医生信息
     */
    @Override
    public List<YlDoctor> selectYlDoctorList(YlDoctor ylDoctor)
    {
        return ylDoctorMapper.selectYlDoctorList(ylDoctor);
    }

    /**
     * 查询所有医生信息列表
     *
     * @return 医生信息
     */
    @Override
    public List<YlDoctor> selectAll() {
        return ylDoctorMapper.selectAll();
    }

    /**
     * 新增医生信息
     * 
     * @param ylDoctor 医生信息
     * @return 结果
     */
    @Override
    public int insertYlDoctor(YlDoctor ylDoctor)
    {
        ylDoctor.setCreateTime(DateUtils.getNowDate());
        return ylDoctorMapper.insertYlDoctor(ylDoctor);
    }

    /**
     * 修改医生信息
     * 
     * @param ylDoctor 医生信息
     * @return 结果
     */
    @Override
    public int updateYlDoctor(YlDoctor ylDoctor)
    {
        ylDoctor.setUpdateTime(DateUtils.getNowDate());
        return ylDoctorMapper.updateYlDoctor(ylDoctor);
    }

    /**
     * 批量删除医生信息
     * 
     * @param doctorIds 需要删除的医生信息主键
     * @return 结果
     */
    @Override
    public int deleteYlDoctorByDoctorIds(Long[] doctorIds)
    {
        return ylDoctorMapper.deleteYlDoctorByDoctorIds(doctorIds);
    }

    /**
     * 删除医生信息信息
     * 
     * @param doctorId 医生信息主键
     * @return 结果
     */
    @Override
    public int deleteYlDoctorByDoctorId(Long doctorId)
    {
        return ylDoctorMapper.deleteYlDoctorByDoctorId(doctorId);
    }

    @Override
    public int updateDoctorState(YlDoctor ylDoctor) {
        return ylDoctorMapper.updateYlDoctor(ylDoctor);
    }
}
